package sf;

import org.smallframework.springboot.SmallOrmAutoConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.data.jpa.JpaRepositoriesAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.boot.autoconfigure.r2dbc.R2dbcAutoConfiguration;
import org.springframework.boot.context.ApplicationPidFileWriter;
import org.springframework.context.ConfigurableApplicationContext;
import sf.codegen.EntityEnhancerJavassist;
import tk.mybatis.spring.annotation.MapperScan;

@MapperScan(basePackages = {
        "sf.mybatis.mapper" })
@SpringBootApplication(exclude = {HibernateJpaAutoConfiguration.class, JpaRepositoriesAutoConfiguration.class,
        SmallOrmAutoConfiguration.class, R2dbcAutoConfiguration.class}, excludeName = {"org.beetl.sql.starter.BeetlSqlStater"})
public class SefApplication {
    public static ConfigurableApplicationContext context;

    public static void main(String[] args) throws Exception {
        new EntityEnhancerJavassist().enhance("db.domain");
//		SpringApplication.run(SefApplication.class, args);
        SpringApplication application = new SpringApplication(SefApplication.class);
        application.addListeners(new ApplicationPidFileWriter());
        context = application.run(args);
    }

}
